
const wechatHandler = require("../v1/handlers/wechatHandler");
const weiboHandler = require("../v1/handlers/weiboHandler");
const twitterHandler = require("../v1/handlers/twitterHandler");
const douyinHandler = require("../v1/handlers/douyinHandler");
const xiaohongshuHandler = require("../v1/handlers/xiaohongshuHandler");
const videoHandler = require("../v1/handlers/videoHandler");
const baijiahaoHandler = require("../v1/handlers/baijiahaoHandler");
const toutiaohaoHandler = require("../v1/handlers/toutiaohaoHandler");
const kuaishouhaoHandler = require("../v1/handlers/kuaishouhaoHandler");
const renminhaoHandler = require("../v1/handlers/renminhaoHandler");
const facebookHandler = require("../v1/handlers/facebookHandler");
const beijinghaoHandler = require("../v1/handlers/beijinghaoHandler");

const logger = require("../utils/logger");
const platformMap = {
  wechat: "微信公众平台",
  weibo: "微博",
  twitter: "Twitter",
  douyin: "抖音",
  xiaohongshu: "小红书",
  video: "视频号",
  baijiahao: "百家号",
  toutiaohao: "头条号",
  kuaishouhao: "快手号",
  renminhao: "人民号",
  facebook: "Facebook",
  beijinghao: "北京号",
};
module.exports = (platform) => {
  logger.info(`正在进行的任务平台: ${platformMap[platform]}`);
  switch (platform) {
    case "wechat":
      return wechatHandler;
    case "weibo":
      return weiboHandler;
    case "twitter":
      return twitterHandler;
    case "douyin":
      return douyinHandler;
    case "xiaohongshu":
      return xiaohongshuHandler;
    case "video":
      return videoHandler;
    case "baijiahao":
      return baijiahaoHandler;
    case "toutiaohao":
      return toutiaohaoHandler;
    case "kuaishouhao":
      return kuaishouhaoHandler;
    case "renminhao":
      return renminhaoHandler;
    case "facebook":
      return facebookHandler;
    case "beijinghao":
      return beijinghaoHandler;
    default:
      throw new Error("NOT_SUPPORT_PLATFORM");
  }
};
